﻿{extend name="public:base" /}

{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post">
                        <div class="box-item layui-form-item adminj-sort-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label layui-form-label">头像</label>
                                <div class="col-sm-3">
                                    <img class="upload-file" src="{$info.avatar}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">用户昵称</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" placeholder="请输入用户昵称" value="{$info.username}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <!--<div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">所在区域</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" readonly value="{$info.address}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>-->


                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">性别</label>
                                <div class="col-sm-3">
                                    <select class="form-control" name="gender">
                                        <option {$info.gender == 0 ? 'selected' : ''}>保密</option>
                                        <option {$info.gender == 1 ? 'selected' : ''}>男</option>
                                        <option {$info.gender == 2 ? 'selected' : ''}>女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">手机号</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" placeholder="请输入用户昵称" name="mobile" value="{$info.mobile}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <!--<div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">会员等级</label>
                                <div class="col-sm-3">
                                    <select class="form-control" name="level" disabled>
                                        <option {$info.level == 1 ? 'selected' : ''}>游客</option>
                                        <option {$info.level == 2 ? 'selected' : ''}>VIP</option>
                                        <option {$info.level == 3 ? 'selected' : ''}>社区服务站</option>
                                        <option {$info.level == 4 ? 'selected' : ''}>县区服务站</option>
                                        <option {$info.level == 5 ? 'selected' : ''}>城市服务站</option>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>-->

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">会员状态</label>
                                <div class="col-sm-3">
                                    <select class="form-control" name="status">
                                        <option {$info.status == 1 ? 'selected' : ''}>正常</option>
                                        <option {$info.status == 2 ? 'selected' : ''}>禁用</option>
                                        <option {$info.status == 3 ? 'selected' : ''}>激活</option>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <!--<div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">推荐人</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" readonly value="{$info.up_username}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">累计消费金额</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" readonly value="{$info.all_consume}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">总累计销售额</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" readonly value="{$info.finance_info.all_consume}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">真实姓名</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="real_name" value="{$info.real_name}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">银行账户</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="back_num" value="{$info.back_num}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>-->


                        <!--<div class="row search-form">
                            <div class="col-sm-2 m-b-sm">
                                <div class="input-group">
                                    <input placeholder="请选择开始日期" type="text" name="start_time" value="" class="start_time form-control form-control-lg screen-date" readonly>
                                </div>
                            </div>
                            <div class="col-sm-2 m-b-sm">
                                <div class="input-group">
                                    <input placeholder="请选择结束日期" type="text" name="end_time" value="" class="end_time form-control form-control-lg screen-date" readonly>
                                </div>
                            </div>
                            <div class="col-sm-2 m-b-sm">
                                <div class="input-group">
                                    <button type="button" class="btn btn-primary btn-lg screen">搜索</button>
                                </div>
                            </div>
                        </div>-->

                        <!--<div class="table-responsive col-lg-8">
                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>所获可用收益统计</th>
                                    <th>成功提现总额统计</th>
                                    <th>充值总金额</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td class="all_profit">{$info.finance_info.all_profit}</td>
                                    <td class="all_withdraw">{$info.finance_info.all_withdraw}</td>
                                    <td class="all_recharge">{$info.finance_info.all_recharge}</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>-->

                        <input type="hidden" class="form-control" name="id" value="{$info.id}">

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                <button type="button" class="btn btn-w-m btn-primary ajax-post">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}


{block name="js"}
<script src="/static/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '.screen-date' //指定元素
    });

    $('.screen').click(function () {
        var user_id = "{$info.id}";
        var start_time = $('.start_time').val();
        var end_time = $('.end_time').val();

        $.post('{:url("censusUserProfit")}',
          {
              user_id: user_id,
              start_time: start_time,
              end_time: end_time
          }, function (res) {
              var res = JSON.parse(res);

              layer.msg(res.msg)
              if (res.result == 1) {
                  $('.all_consume').html(res.data.all_consume);
                  $('.all_profit').html(res.data.all_profit);
                  $('.all_withdraw').html(res.data.all_withdraw);
                  $('.all_recharge').html(res.data.all_recharge);
              }
          })

    })
</script>
{/block}